<template>
    <el-dialog
        :before-close="handlerClose"
        :title.sync="config[operateType].title"
        :visible.sync="showDialog"
        top="5vh"
        width="50%"
        append-to-body
    >
        <el-row :gutter="10">
            <el-col :span="12">
                <span
                    class="el-button el-button--text el-button--small default-text"
                >{{config[operateType].selectPlan}}</span>
                <el-input v-if="operaType==='add'"/>
                <el-select v-else>
                    <el-option label="方案1" value="1"/>
                </el-select>
            </el-col>
            <el-col :span="6">
                <div class="empty-box"></div>
            </el-col>
            <el-col :span="6">
                <div class="float-right">
                    <el-button @click="cancel">取消</el-button>
                    <el-button type="primary" @click="submit">确认</el-button>
                </div>
            </el-col>
        </el-row>
    </el-dialog>
</template>
<script>
export default {
    props: {
        operateType: {
            type: String,
            required: true
        }
    },
    mounted() {
        console.log(this.operateType);
    },
    data() {
        return {
            showDialog: true,
            config: {
                save: {
                    title: "保存方案",
                    selectPlan: "方案名称"
                },
                delete: {
                    title: "删除方案",
                    selectPlan: "删除方案"
                }
            }
        };
    },
    mounted() {
        //this.init();
    },
    methods: {
        handlerClose(done) {
            this.$emit("closeSaveOrDelete");
        },
        cancel() {
            this.handlerClose();
        },
        submit() {}
    }
};
</script>
<style>
.default-text {
    color: #606266;
    cursor: auto;
}
.default-text:hover {
    color: #606266;
}
</style>

